load("@io_bazel_rules_docker//container:image.bzl", "container_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("//prow:def.bzl", "prow_image")

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "k8s.io/test-infra/prow/cmd/checkconfig",
    visibility = ["//visibility:private"],
    deps = [
        "//prow/apis/prowjobs/v1:go_default_library",
        "//prow/config:go_default_library",
        "//prow/config/secret:go_default_library",
        "//prow/external-plugins/needs-rebase/plugin:go_default_library",
        "//prow/flagutil:go_default_library",
        "//prow/github:go_default_library",
        "//prow/hook/plugin-imports:go_default_library",
        "//prow/kube:go_default_library",
        "//prow/labels:go_default_library",
        "//prow/logrusutil:go_default_library",
        "//prow/plugins:go_default_library",
        "//prow/plugins/approve:go_default_library",
        "//prow/plugins/blockade:go_default_library",
        "//prow/plugins/blunderbuss:go_default_library",
        "//prow/plugins/bugzilla:go_default_library",
        "//prow/plugins/cherrypickunapproved:go_default_library",
        "//prow/plugins/hold:go_default_library",
        "//prow/plugins/lgtm:go_default_library",
        "//prow/plugins/owners-label:go_default_library",
        "//prow/plugins/releasenote:go_default_library",
        "//prow/plugins/trigger:go_default_library",
        "//prow/plugins/verify-owners:go_default_library",
        "//prow/plugins/wip:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@io_k8s_apimachinery//pkg/util/errors:go_default_library",
        "@io_k8s_apimachinery//pkg/util/sets:go_default_library",
        "@io_k8s_apimachinery//pkg/util/validation:go_default_library",
        "@io_k8s_sigs_yaml//:go_default_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [":package-srcs"],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)

NAME = "checkconfig"

prow_image(
    name = "image",
    base = "@git-base//image",
    component = NAME,
    directory = "/",
    files = [":checkconfig"],
    visibility = ["//visibility:public"],
)

go_binary(
    name = NAME,
    embed = [":go_default_library"],
    pure = "on",
    visibility = ["//visibility:public"],
)

go_test(
    name = "go_default_test",
    srcs = ["main_test.go"],
    data = glob(["testdata/**"]),
    embed = [":go_default_library"],
    deps = [
        "//prow/apis/prowjobs/v1:go_default_library",
        "//prow/config:go_default_library",
        "//prow/flagutil:go_default_library",
        "//prow/github:go_default_library",
        "//prow/plugins:go_default_library",
        "@com_github_google_go_cmp//cmp:go_default_library",
        "@io_k8s_apimachinery//pkg/util/diff:go_default_library",
        "@io_k8s_apimachinery//pkg/util/errors:go_default_library",
        "@io_k8s_apimachinery//pkg/util/sets:go_default_library",
        "@io_k8s_sigs_yaml//:go_default_library",
        "@io_k8s_utils//pointer:go_default_library",
    ],
)
